package chapter6;

/**
 * 利用抽象类实现模板模式类似的功能
 */
public abstract class SpeedMeter {
    private double turnRate;
    public SpeedMeter(){}
    public abstract double calGirth();

    public void setTurnRate(double turnRate) {
        this.turnRate = turnRate;
    }

    public double getSpeed() {
        return calGirth() * turnRate;
    }
}
